﻿using EfDomain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;


namespace EfInfra.EntityConfigurations
{
    public class OneToManyConfigurations : IEntityTypeConfiguration<Author>
    {
        public void Configure(EntityTypeBuilder<Author> builder)
        {
            builder
               .HasMany(e => e.Books)
               .WithOne(e=>e.Author)
               .HasForeignKey("AuthorId");
        }
    }
}